<template>
  <div v-if="user_dali == true" class="more-serve">
    <view
      v-show="user_dali"
      v-for="(item, index) in moreServerList"
      :key="index"
      @click="toPage(item)"
    >
      <view :class="['custom-icon', item.icon]"> </view>
      <view>{{ item.name }}</view>
    </view>
  </div>
  <div v-else class="more-server">...暂无更多功能...</div>
</template>

<script>
export default {
  data() {
    return {
      user_dali: false,
      moreServerList: [
        {
          icon: "custom-icon-paisong",
          name: "派送取单",
          router: "/pages/moreServe/components/sendQuOrder",
        },
        {
          icon: "custom-icon-saoma",
          name: "扫码完成",
          router: "/pages/moreServe/components/scanFinish",
        },
      ],
    };
  },
  methods: {
    /**
     * 跳转到相应的 路由
     */
    toPage(item) {
      console.log(item);
      uni.navigateTo({
        url: item.router,
      });
    },
  },
  onShow() {
    if (this.vuex_userInfo.userRole === 1) {
      this.user_dali = true;
    }
  },
};
</script>

<style scoped lang ='scss' >
.more-serve {
  width: 100v;
  min-height: 100vh;
  background-color: #eff5f7;
  padding: 10px;
  & > view {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 100rpx;
    font-size: 40rpx;
    background-color: #fff;
    border-radius: 20rpx;
    margin-top: 30rpx;
    color: #adb838;
    /* box-shadow: 10rpx 3rpx 10rpx 5rpx #c0c4cc; */
    & > view:nth-child(1) {
      margin-right: 20rpx;
      font-size: 50rpx;
    }
  }
}

.more-server {
  text-align: center;
  margin-top: 40rpx;
  color: #666666;
}
</style>
